 function getCookie(name) { 
    
    var arr;
    var reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
    if (arr = document.cookie.match(reg))
      return  decodeURI(arr[2]);
    else
      return null;
}
 function setCookie(name, value, day) {
  if(day !== 0){     //当设置的时间等于0时，不设置expires属性，cookie在浏览器关闭后删除
    var expires = day * 24 * 60 * 60 * 1000;
    var date = new Date(+new Date()+expires);
    document.cookie = name + "=" + encodeURI(value) + ";expires=" + date.toUTCString();
  }else{
    document.cookie = name + "=" + encodeURI(value);
  }
};
function timeChange(time){
  var d = new Date(time); 
  var datetime=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
  return datetime
}
function getQueryString() {
	
  var r = window.location.href;
  var name = r.split('=')[1]
	if ( name != null ){
		 return name;
	}else{
		 return null;
	} 
}
export  {getCookie,setCookie,timeChange,getQueryString}